<!-- 视图层 -->
<template>
  <div class="box">
    <header class="header"><span>分类</span></header>
    <div class="content">
      <MyCategoryList :categoryList="categoryList"></MyCategoryList>
      <slot></slot>
    </div>
  </div>
</template>

<!-- 逻辑层 -->
<script setup>

import { ref,onMounted} from 'vue';
import MyCategoryList from './MyCategoryList.vue';
import { getCategoryList } from '@/api/cate';
let categoryList = ref([])

onMounted(()=>{
      getCategoryList().then(({data:res})=> {
        categoryList.value = res.data
      })
  })
  
</script> 


<!-- 样式层 -->
<style scoped>
  .header{
    height: 55px;
    background-color: palevioletred;
    color: aliceblue;
    font-size: 25px;
    /* text-align: center; */
    line-height: 55px;
    display: flex;
    position: sticky;
    top:0;
    z-index:1;;
  }
  .header>span{
    color: aliceblue;
    font-size: 25px;
   margin-left: 150px;
    line-height: 55px;
  }
  .content{
    display: flex;
  }
</style>
